home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-10-17 | 3.9 KB | 235 lines | [TEXT/MPS ] |
- /*
- HideMenuBarExample.r
- MPW 3.0 Rez source for menu bar hiding example.
- Copyright © 1989 D. Grant Leeper.
- All rights reserved.
- Publication rights granted to MacTutor.
- */
-
- #include "Types.r"
- #include "SysTypes.r"
-
- #define kMinSize 24
- #define kPrefSize 32
-
- #define rWindow 128
- #define rMenuBar 128
- #define rAboutAlert 128
- #define rFatalAlert 129
- #define rMessages 128
-
- #define mApple 128
- #define mFile 129
- #define mEdit 130
-
- resource 'WIND' (rWindow, preload, purgeable) {
- {30, 80, 100, 504},
- zoomDocProc, visible, noGoAway, 0x0,
- "Menu Bar Hiding Example"
- };
-
- resource 'MBAR' (rMenuBar, preload) {
- { mApple, mFile, mEdit };
- };
-
- resource 'MENU' (mApple, preload) {
- mApple, textMenuProc,
- 0x7FFFFFFF & ~0b10,
- enabled, apple,
- {
- "About HideMenuBarExample…",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain
- }
- };
-
- resource 'MENU' (mFile, preload) {
- mFile, textMenuProc,
- 0b10,
- enabled, "File",
- {
- "Close",
- noicon, "W", nomark, plain;
- "Quit",
- noicon, "Q", nomark, plain
- }
- };
-
- resource 'MENU' (mEdit, preload) {
- mEdit, textMenuProc,
- 0,
- enabled, "Edit",
- {
- "Undo",
- noicon, "Z", nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Cut",
- noicon, "X", nomark, plain;
- "Copy",
- noicon, "C", nomark, plain;
- "Paste",
- noicon, "V", nomark, plain;
- "Clear",
- noicon, nokey, nomark, plain
- }
- };
-
- resource 'ALRT' (rAboutAlert, purgeable) {
- {60, 40, 184, 340},
- rAboutAlert,
- { /* array: 4 elements */
- /* [1] */
- OK, visible, silent,
- /* [2] */
- OK, visible, silent,
- /* [3] */
- OK, visible, silent,
- /* [4] */
- OK, visible, silent
- }
- };
-
- resource 'DITL' (rAboutAlert, purgeable) {
- { /* array DITLarray: 5 elements */
- /* [1] */
- {92, 110, 112, 190},
- Button {
- enabled,
- "OK"
- },
- /* [2] */
- {4, 78, 20, 222},
- StaticText {
- disabled,
- "HideMenuBarExample"
- },
- /* [3] */
- {24, 37, 40, 262},
- StaticText {
- disabled,
- "Copyright © 1989 D. Grant Leeper."
- },
- /* [4] */
- {44, 86, 60, 214},
- StaticText {
- disabled,
- "All rights reserved."
- },
- /* [5] */
- {64, 19, 80, 281},
- StaticText {
- disabled,
- "Publication rights granted"
- " to MacTutor."
- }
- }
- };
-
- resource 'ALRT' (rFatalAlert, purgeable) {
- {40, 20, 144, 312},
- rFatalAlert,
- { /* array: 4 elements */
- /* [1] */
- OK, visible, silent,
- /* [2] */
- OK, visible, silent,
- /* [3] */
- OK, visible, silent,
- /* [4] */
- OK, visible, silent
- }
- };
-
- resource 'DITL' (rFatalAlert, purgeable) {
- { /* array DITLarray: 2 elements */
- /* [1] */
- {72, 180, 92, 260},
- Button {
- enabled,
- "OK"
- },
- /* [2] */
- {10, 60, 58, 276},
- StaticText {
- disabled,
- "HideMenuBarExample - An "
- "unexpected error has occurred. "
- "(Probably out of memory.)"
- }
- }
- };
-
- resource 'STR#' (rMessages, purgeable) {
- { /* array stringArray: 7 elements */
- /* [1] */
- "Bring application to front to hide "
- "menu bar.",
- /* [2] */
- "Bring window to front to hide menu bar.",
- /* [3] */
- "Bring window to front to show menu bar.",
- /* [4] */
- "Press Command-Space to hide menu bar.",
- /* [5] */
- "Press Command-Space to show menu bar, "
- "or try clicking on the ",
- /* [6] */
- "desktop where a menu title should be, "
- "or try command-clicking ",
- /* [7] */
- "on the desktop where the menu bar "
- "should be."
- }
- };
-
- /*
- We are MultiFinder aware and friendly.
- We are probably 32 bit compatible as well but
- have not been tested in a 32 bit environment.
- */
-
- resource 'SIZE' (-1) {
- dontSaveScreen,
- acceptSuspendResumeEvents,
- enableOptionSwitch,
- canBackground,
- multiFinderAware,
- backgroundAndForeground,
- dontGetFrontClicks,
- ignoreChildDiedEvents,
- not32BitCompatible, /* Not tested */
- reserved,
- reserved,
- reserved,
- reserved,
- reserved,
- reserved,
- reserved,
- kPrefSize * 1024,
- kMinSize * 1024
- };
-
- resource 'vers' (1) {
- 0x1,
- 0x0,
- release,
- 0x0,
- verUs,
- "1.0",
- "1.0 © 1989 D. Grant Leeper\n"
- "All rights reserved."
- };
-
- resource 'vers' (2) {
- 0x1,
- 0x0,
- release,
- 0x0,
- verUs,
- "1.0",
- "Hiding The Menu Bar"
- };
-
-